home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / et / et3_0-a1.lha / et3 / src / LineItem.C < prev    next >
C/C++ Source or Header  |  1992-04-27  |  805b  |  44 lines

  1. #ifdef __GNUG__
  2. #pragma implementation
  3. #endif
  4.  
  5. #include "LineItem.h"
  6.  
  7. #include "Class.h"
  8.  
  9. //---- LineItem ----------------------------------------------------------------
  10.  
  11. NewMetaImpl(LineItem,VObject, (TB(dir)));
  12.  
  13. LineItem::LineItem(bool d, int lw, int ml, int id) : VObject(id)
  14. {
  15.     dir= d;
  16.     lineWidth= lw;
  17.     minLength= ml;
  18. }
  19.  
  20. Metric LineItem::GetMinSize()
  21. {
  22.     if (dir)
  23.     return Metric(minLength, lineWidth);
  24.     return Metric(lineWidth, minLength);
  25. }
  26.  
  27. void LineItem::Draw(Rectangle)
  28. {
  29.     GrPaintRect(contentRect, Enabled() ? ePatBlack : ePatGrey50);
  30. }
  31.  
  32. OStream& LineItem::PrintOn (OStream& o)
  33. {
  34.   VObject::PrintOn(o);
  35.   return o <<lineWidth SP << minLength SP << dir NL;
  36. }
  37.  
  38. IStream& LineItem::ReadFrom(IStream& i)
  39. {
  40.   VObject::ReadFrom(i);
  41.   return i >> lineWidth >> minLength >> Bool(dir);
  42. }
  43.  
  44.